package shenlong.android.motorkeeper.key.dto;

import shenlong.android.motorkeeper.key.common.Constant.BluetoothCommunicationType;
import android.bluetooth.BluetoothDevice;

public class BTDevice {
	private Object runtimeDevice;
	private BluetoothCommunicationType bluetoothCommunicationType;
	public BTDevice(Object device, BluetoothCommunicationType commType)
	{
		this.runtimeDevice = device;
		this.bluetoothCommunicationType = commType;
	}
	public String getSummary()
	{
		String summary = "";
		String communicationType = "";
		if(this.bluetoothCommunicationType == BluetoothCommunicationType.PAIRED)
		{
			communicationType = "Paired";
		}
		else
		{
			communicationType = "Unknown";
		}
		if(runtimeDevice instanceof BluetoothDevice)
		{
			BluetoothDevice device = (BluetoothDevice)runtimeDevice;
			summary = device.getName() + "\n"  
					+ " - " + device.getAddress() + "\n"
					+ " - " + device.getBondState() + "\n"
			    	+ " - " + communicationType;
		}
		else
		{
			summary = "Not Bluetooth Device";
		}
		return summary;
	}
}
